package com.javacode2018.lesson001.demo9;

import com.javacode2018.lesson001.demo5.IocUtil;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: hongsir
 * @Date: 2024/10/10 - 10 - 10 - 15:18
 * @Description: com.javacode2018.lesson001.demo8
 * @Version: 1.0
 */
public class AutowireCandidateTest {
    @Test
    public void normalBean(){
        String beanXml = "classpath:/com/javacode2018/lesson001/demo9/autowireCandidateBean.xml";
        ClassPathXmlApplicationContext context = IocUtil.context(beanXml);
        System.out.println(context.getBean(SetterBean.class)); //@1

        SetterBean.IService service = context.getBean(SetterBean.IService.class); //@2
        System.out.println(service);
    }
}
